const app = getApp();

Page({
    data: {
        
    },
    formSubmit(e){
      let data = e.detail.value
      let user_id = wx.getStorageSync("users").id
      for(let i in data){
        if(!data[i]) {
          wx.showToast({
            title: i + '不能为空',
            icon: 'none'
          })
          return
        }
      }
      data['user_id'] = user_id
      app.util.request({
        url: 'entry/wxapp/FromSubmits',
        data,
        success(res){
          wx.showToast({
            title: res.data.msg
          }, 2000)
          if(res.data.status == 1) {
            setTimeout(() => {
              wx.navigateBack({})
            }, 2000)
          }
        }
      })
    }
});